<?php
/**
 * GioCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@ninhgio.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2010 Gio CMS (http://www.ninhgio.com)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 */
?>
var G_AD_ZONES = new Array();
<?php if (isset($this->zones) && $this->zones != null) : ?>
<?php foreach ($this->zones as $zone) : ?>
G_AD_ZONES['<?php echo $zone['code']; ?>'] = { 
	id: '<?php echo $zone['zone_id']; ?>', 
	name: '<?php echo $zone['description']; ?>',
	width: <?php echo $zone['width']; ?>,
	height: <?php echo $zone['height']; ?>
};
<?php endforeach; ?>
<?php endif; ?>

var G_AD_BANNERS = new Array();
<?php if (isset($this->banners) && count($this->banners) > 0) : ?>
<?php foreach ($this->banners as $index => $banner) : ?>
G_AD_BANNERS[G_AD_BANNERS.length] = {
	id: '<?php echo $banner['banner_id']; ?>', 
	zone: { 
		id: '<?php echo $banner['banner_zone_id']; ?>'
	}, 
	options: { 
		format: '<?php echo $banner['format']; ?>', 
		text: '<?php echo $banner['name']; ?>', 
		code: '<?php echo Gio_Core_HtmlCompress::compress(addslashes($banner['html_code'])); ?>', 
		clickUrl: '<?php echo $banner['url']; ?>', 
		target: '_blank', 
		imageUrl: '<?php echo $banner['file_url']; ?>', 
		pageUrl: '<?php echo str_replace('\\', '\\\\', $banner['page_url']); ?>', 
		route: '<?php echo $banner['route']; ?>', 
		mode: '<?php echo $banner['mode']; ?>', 
		timeout: 10,
		width: '<?php echo $banner['width']; ?>',
		height: '<?php echo $banner['height']; ?>'
	},
	baseUrl: '<?php echo $this->APP_WEB_URL; ?>'
};
<?php endforeach; ?>
<?php endif; ?>